<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>web存储</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/js-cookie/2.2.1/js.cookie.js"></script>
</head>
<body>
  
</body>
<script>
  window.onload = function() {
    // cookie
    // Cookies.set('name', 'zhangsan', { expires: 7 });
    // Cookies.remove('name');
    // console.log(Cookies.get('name'));

    //sessionStroge
    window.sessionStorage.setItem('age', 13);
    window.sessionStorage.removeItem('age');
    console.log(window.sessionStorage.getItem('age'));
    
    // localStroge
    window.localStorage.setItem('gender', 'male');
    console.log(window.localStorage.getItem('gender'));
  }
</script>
</html>